<% #endcoding:utf-8%>
<!DOCTYPE html>
<html>
<head>
  <meta name="baidu-site-verification" content="oH1xWNxnG2" />
  <title><%if @title.nil?%>验厂招标网<%else%><%=@title%>-验厂招标网<%end%> </title>
  <%= favicon_link_tag  'favicon.ico'%>
  <%= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>
<div id="header">
  <nav class="navbar navbar-default">
    <div class="container-fluid">
      <!-- Brand and toggle get grouped for better mobile display -->
      <div class="navbar-header">
        <a  id="brand" href="/" ><span class="part1">无忧</span><span class="part2">验厂招标</span></a>
      </div>

      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
        <%=render partial: "shared/searchbox"%>
        <%=render partial: "shared/nav"%>
        <ul class="nav navbar-nav navbar-right">
          <% if logged?%>
              <li><a href="/mymessages"><span class="glyphicon glyphicon-bell"></span>(<%=unread_msg_count%>)</a></li>
              <li>
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><%=userinfo[:name]%><span class="caret"></span></a>
                <ul class="dropdown-menu">
                  <li><%=link_to '个人中心',user_path(userinfo)%></li>
                  <% if isfactory?userinfo%>
                  <li><%=link_to '发布需求',new_demand_path%></li>
                  <li><%=link_to '我的需求',"/mydemand/"+uid%></li>
                  <%else%>
                  <li role="presentation" class="<% if params[:controller]=="offers"%>active<%end%>"><a href="/myoffers/<%=uid%>">我的投标</a></li>
                  <%end%>
                  <li><a href='/editprofile'>修改资料</a></li>
                  <li><%=link_to "退出",logout_path , method:"delete"%></li>
                </ul>
              </li>
          <%else%>
          <li>
            <a href="<%=login_path%>" role="button" aria-haspopup="true" aria-expanded="false">登录 </a>
          </li>
          <li class="dropdown">
            <a href="<%=register_path%>" role="button" aria-haspopup="true" aria-expanded="false">注册 </a>
          </li>
          <%end%>
        </ul>

      </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
  </nav>
</div>

